ShowTable of Contents
Abstract
Domino Access Services (DAS) is a family of REST APIs built into IBM Domino and available from the XPages Extension Library
on OpenNTF. The DAS data API is used to create, read, update and delete data in any Domino server application. This article describes some techniques for optimizing the performance of the data API. It assumes you already have some experience with this API. For more general information on the data API, see this reference
.
Introduction
The DAS data API is designed to provide access over HTTP/HTTPS to virtually any Domino server application. When you use the data API to read a view, an individual document, or other data object, the default response often contains more data than you actually need to implement your application. Since the data API cannot infer what's important to you, it returns the maximum amount of data. Fortunately, you can often boost performance by requesting less data. It's simply a matter of adding one or more query parameters to the request URL.
One example of this is the compact parameter. This is a boolean query parameter you can use in any GET request. Consider, for example, the database collection request:
The response is a potentially large array of databases like this:
[
{
"@title": "Administration Requests",
"@filepath": "admin4.nsf",
"@replicaid": "852573910361A2F4",
"@template": "StdR4AdminRequests",
"@href": "/admin4.nsf/api/data/collections"
},
{
"@title": "Java AgentRunner",
"@filepath": "AgentRunner.nsf",
"@replicaid": "8525671400725208",
"@template": "",
"@href": "/AgentRunner.nsf/api/data/collections"
},
...
]
By default, the response include lots of white space including spaces and new line characters. This white space increases readability and is helpful when you are learning about the data API, but it's not necessary as you move your application into production. You can remove the white space from the response by adding the compact parameter to your request:
GET /api/data?compact=true
Depending on your network bandwidth and the number of databases on your server, this can reliably shave several milliseconds off the database collection response time. Best of all, the compact parameter is available for all data API GET requests.
View Read Performance
Document Read Performance
Conclusion